Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: integration with Angular templates #40

Merged
merged 3 commits into from
Oct 31, 2016

Conversation

jirikuncar
Copy link
Member

Signed-off-by: Jiri Kuncar jiri.kuncar@cern.ch

contents = property(_get_contents, Bundle._set_contents)


class AngularGettextFilter(Filter):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this will be added to Invenio-Assets or I18N and that this is just proof-of-concept?

name = 'angular-gettext'

def output(self, _in, out, **kwargs):
out.write("angular.module('tindThemeTranslations', ['gettext']).run(['gettextCatalog', function (gettextCatalog) {")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewm89 we should find a way how to make tindThemeTranslations configurable from Bundle.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jirikuncar is there are way to get the module name? We can then use this to replace 'tindTheme'. It should then be easier to do the import of the translations in the angular app based on the module name + 'Translations'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check if there is something usable in self or kwargs.


def input(self, _in, out, **kwargs):
import ipdb
ipdb.set_trace()
Copy link
Member

@drjova drjova Oct 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the PR is still a WIP :)

@jirikuncar
Copy link
Member Author

Depends on inveniosoftware/invenio-assets#51

@jirikuncar jirikuncar force-pushed the angular-gettext-babel branch 3 times, most recently from 932b837 to ab0fafe Compare October 20, 2016 09:01
@jirikuncar
Copy link
Member Author

Since Invenio-Assets v1.0.0b4 is out we have green light on Travis. More reliable language code detection will come with inveniosoftware/invenio-assets#54.

Please note that in order to fully plug translations, there is a work needed on language selector in inveniosoftware/invenio-i18n#34 probably by setting a cookie with selected language that will be shared by frontend and backend.

@lnielsen
Copy link
Member

LGTM

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
* Adds new bundle with translations for Angular application.
  (addresses inveniosoftware/invenio-i18n#34)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
@jirikuncar
Copy link
Member Author

@lnielsen finally we have a green light 🎉

@lnielsen lnielsen merged commit e67c165 into inveniosoftware:master Oct 31, 2016
@jirikuncar jirikuncar deleted the angular-gettext-babel branch October 31, 2016 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants